package com.feicheng.house.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import com.feicheng.house.exception.SystemException;
import com.feicheng.house.result.ResultInfo;

import com.feicheng.house.service.IClientVipDepositVoService;

/**
 * <p>
 * VIEW 前端控制器
 * </p>
 *
 * @author feichengTech
 * @since 2021-11-06
 */
@RestController
@RequestMapping("/house/client-vip-deposit-vo")
public class ClientVipDepositVoController {
	
	@Autowired
	IClientVipDepositVoService iClientVipDepositVoServiceImpl;
	
	/**
	 * 根据相关入参查询client表，若无全查询client表
	 * @param currentPage
	 * @param pageSize
	 * @param searchKey	 
	 * @return 查询到的用户和分页详情
	 */
	@GetMapping("/page")
	public ResultInfo getClientList(Integer currentPage, Integer pageSize, String searchKey) {
		return iClientVipDepositVoServiceImpl.getClientList(currentPage, pageSize, searchKey);
	};
	
	/**
	 * 根据用户ID查询对应客户
	 * @param clientId
	 * @return 查询到的客户
	 */
	@GetMapping("/info")
	public ResultInfo getClient(Integer clientId) {
		if (null == clientId) {
			throw new SystemException("权限ID缺失");
		}
		
		return iClientVipDepositVoServiceImpl.getClient(clientId);
	}

}

